var user = getUserInfo();

if(!user){
    window.confirm("没有登录, 不允许进来");
}

var vue = new Vue({
    el:"#app",
    data:{
        owner:{},
        visitors:[],
        totalView:20,
        todayView:20,
        follows:0,
        followsUsers:[],
        fans:0

    },
    methods:{
    },
    filters:{
    },
    mounted:function () {
        var _this = this;
        var param = getParams();
        // 插叙当前窝的用户信息
        ajaxGet("/users/get", {id:param.ownerId}, function (data) {
            vue.owner = data.data;
        });
        // 查询当前窝下的访客
        ajaxPost("/users/visitor", {ownerId:param.ownerId, currentUId: user.id}, function (data) {
            var map = data.data;
            _this.visitors = map.visitors;
            _this.totalView = map.totalView;
            _this.todayView = map.todayView;
        });
        // 查询粉丝与关注数
        ajaxGet("/users/fansFollow", {id:param.ownerId}, function (data) {
            var map = data.data;
            _this.follows = map.follows;
            _this.fans = map.fans;
            _this.followsUsers = map.followsUsers;
        });
    }
});

